<?php
	require 'model/reqservico.php';
	//require 'controller/controller.php';
	require 'banco.php';
	
	session_start();
	//echo $_SESSION['iden'];
	$id = $_SESSION['iden'];
	//session_destroy();
	
	//$contro = new ControllerReqServico;
	//$data = $contro->retornaReqServico($id);
	$banco = new Banco();
	$data = $banco->retornaReqServico($id);
	$solicitante = $data['solicitante'];
	$matricula = $data['matricula'];
	$datareq = $data['data'];
	$cargo = $data['cargo'];
	$email = $data['email'];
	$setor = $data['setor'];
	$ramal = $data['ramal'];
	$servico = $data['servico'];
	$local_reparo = $data['local_reparo'];
	$descricao = $data['descricao'];
	
	$_SESSION['identificador'] = $id;
	$_SESSION['solicitante'] = $solicitante;
	$_SESSION['matricula'] = $matricula;
	$_SESSION['data'] = $datareq;
	$_SESSION['cargo'] = $cargo;
	$_SESSION['email'] = $email;
	$_SESSION['setor'] = $setor;
	$_SESSION['ramal'] = $ramal;
	$_SESSION['servico'] = $servico;
	$_SESSION['local_reparo'] = $local_reparo;
	$_SESSION['descricao'] = $descricao;
	
	function gerarPdf(){
		header('Location: requerimento_pdf.php');
	}
	
?>

<!DOCTYPE html>
<html lang="en">
<head> 
  <meta charset="utf-8">
  <title>Requerimento de Solicitação de Serviço</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">
	
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="css/style.css" rel="stylesheet">

  <!-- Fav and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="img/favicon.ico">
  
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/scripts.js"></script>
</head>

<body>
<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">
						<span class="glyphicon glyphicon-user"></span> <strong>Solicitação Realizada</strong>
					</h3>
				</div>
				<div class="panel-body">
			<form role="form" class="form-horizontal" method="POST" name="form1" action="controller/controller.php">
				<div class="form-group">
					 <label class="col-sm-2"><font color='red'>ID: <?php echo $id?></font><font> | <a href="requerimento_pdf.php">Gerar PDF</a></font></label>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">Solicitante</label>
					<div class="col-sm-7">
						<input type="text" class="form-control" name="solicitante" maxlength="100" value="<?php echo $solicitante;?>" /readonly>
					</div>
					<label class="col-sm-1 control-label">Matrícula</label>
					<div class="col-sm-2">
						<input type="text" class="form-control" name="matricula" maxlength="8" onkeypress='return SomenteNumero(event)'  value="<?php echo $matricula; ?>" readonly>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">Cargo</label>
					<div class="col-sm-3">
						<input type="text" class="form-control" name="cargo" maxlength="50" value="<?php echo $cargo; ?>" readonly>
					</div>
					<label class="col-sm-1 control-label" for="exampleInputEmail1">Email</label>
					<div class="col-sm-6">
						<input type="email" class="form-control" id="exampleInputEmail1" name="email" value="<?php echo $email; ?>" readonly />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">Setor</label>
					<div class="col-sm-3">
						<input type="text" class="form-control" name="setor" maxlength="50" value="<?php echo $setor; ?>" readonly>
					</div>
					<label class="col-sm-1 control-label">Ramal</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="ramal" maxlength="4" onkeypress='return SomenteNumero(event)' value="<?php echo $ramal; ?>" readonly />
					</div>
				</div>
				<div class="form-group ">
					<label class="col-sm-2 control-label">Serviço requerido:</label>
					<div class="col-sm-1 control-label">
						 <input type="radio" name="servico" id="carpintaria" value="carpintaria" <?php if($servico == "carpintaria"){?> checked <?php }?> disabled>
					</div>
					<div class="col-sm-1 control-label">
						<label for="carpintaria">Carpintaria</label>
					</div>
					<div class="col-sm-1 control-label">
						<input type="radio" name="servico" id="eletricista" value="eletricista" <?php if($servico == "eletricista"){?> checked <?php }?> disabled>
					</div>
					<div class="col-sm-1 control-label">
						<label for="eletricista">Eletricista</label>
					</div>
					<div class="col-sm-1 control-label">
						<input type="radio" name="servico" id="oficina" value="oficina" <?php if($servico == "oficina"){?> checked <?php }?> disabled>
					</div>
					<div class="col-sm-1 control-label">
						<label for="oficina">Oficina</label>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-3 control-label">
						<input type="radio" name="servico" id="encanador" value="encanador" <?php if($servico == "encanador"){?> checked <?php }?> disabled>
					</div>
					<div class="col-sm-1 control-label">
						<label for="encanador">Encanador</label>
					</div>
					<div class="col-sm-1 control-label">
						<input type="radio" name="servico" id="pedreiro" value="pedreiro" <?php if($servico == "pedreiro"){?> checked <?php }?> disabled>
					</div>
					<div class="col-sm-1 control-label">
						<label for="pedreiro">Pedreiro</label>
					</div>
					<div class="col-sm-1 control-label">
						<input type="radio" name="servico" id="servico_geral" value="serviços gerais" <?php if($servico == "serviços gerais"){?> checked <?php }?> disabled>
					</div>
					<div class="col-sm-1 control-label">
						<label for="oficina">Serviços Gerais</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">Local do Reparo</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="reparo" maxlength="50" value="<?php echo $local_reparo; ?>" readonly>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">Descrição</label>
					<div class="col-sm-10">
						<textarea name="descricao" type="text" class="form-control" maxlength="300" readonly><?php echo $descricao; ?></textarea>
					</div>
				</div>
			</form>
				</div>
	<div class="panel-footer">
					<small><p class="text-right text-muted">Desenvolvido pela <a href="http://www.ifsertao-pe.edu.br/dgti" target="_blank" title="Coordenação de Tecnologia da Informação">CTI</a></p></small>
	</div>
</div>
</body>
</html>
